package com.tarena.all;
import java.util.*;

public class ArrayDemo {

	/**
	 * @param 数组的复制和扩容
	 */
	public static void main(String[] args) {
		Random ran=new Random();
		int[] arr1=new int[4];
		for(int i=0;i<arr1.length;i++){
			arr1[i]=ran.nextInt(100)+1;
		}
		arr1[3]=128;
		System.out.println("数组Arr1为："+Arrays.toString(arr1));
		int[] arr2=arr1;
		System.out.println("数组Arr2为："+Arrays.toString(arr2));
		
		int[] arr3=new int[arr1.length];
		for(int i=0;i<arr3.length;i++){
			arr3[i]=arr1[i];
		}
		System.out.println("数组Arr1为："+Arrays.toString(arr1));
		System.out.println("数组Arr3为："+Arrays.toString(arr3));
	}

}
